#pragma once

#ifndef UTILITY_H
#define UTILITY_H

#include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <locale>
#include <codecvt>
#include "nlohmann/json.hpp"

struct Regin
{
    std::string adcode;
    std::string name;
    std::string boundary;
    std::vector<Regin> subsets;
};

struct Extent
{
    double minLng;
    double maxLng;
    double minLat;
    double maxLat;
};

std::vector<std::string> stringSplit(const std::string& str, const std::string& delim);
std::string UTF8ToString(const std::string& utf8Data);
void findExtent(const Regin& _ds, const std::string& regName, Extent& extent);
void FromJson(const nlohmann::json& jsonObj, Regin& regin);

#endif // UTILITY_H